<div id="withdrawal1" class="subcontent1 margintop20">
    <div class="formpanel">
        <div class="wd-row">
            <div class="wd-col1">当前密码：</div>
            <div class="wd-col2">
                <input type="password" id="loginpwd" class="textfield1">
            </div>
            <div class="clear"></div>
        </div>
        <div class="wd-row">
            <div class="wd-col1">新密码：</div>
            <div class="wd-col2">
                <input type="password" id="newpwd" class="textfield1">
            </div>
            <div class="clear"></div>
        </div>
        <div class="wd-row">
            <div class="wd-col1">确认密码：</div>
            <div class="wd-col2">
                <input type="password" id="rednewpwd" class="textfield1">
            </div>
            <div class="clear"></div>
        </div>
        <div class="wd-row" style="text-align: center;">
            <input type="button" class="c-button" value="提交">
        </div>
    </div>
</div>

<script>
    $("#withdrawal1 .c-button").click(function() {
        var old = $("#loginpwd").val().trim(),
            p1 = $("#newpwd").val().trim(),
            p2 = $("#rednewpwd").val().trim();
        if (old == '') {
            alert2("请输入当前登录密码", true);
            return;
        }
        if (p1 == '') {
            alert2("请输入要设置的新的登录密码", true);
            return;
        }
        if (p1 != p2) {
            alert2("两次输入的密码不一致，请重新输入", true);
            return;
        }

        startLoading();
        CMD.modify_password(p1, old, function() {
            stopLoading();
            alert2("修改登录密码成功");
        }, function(message) {
            stopLoading();
            alert2(message || '修改登录密码失败', true);
        });
    });
</script>